package com.company.cloud.mall.modules.app.controller.resp;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.company.cloud.mall.modules.base.entity.CartInfo;
import com.company.cloud.product.modules.api.response.ProductSkuSpecificationItem;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class CartItemModel {

     @ApiModelProperty(value = "ID")
     private Integer id;

     @ApiModelProperty(value = "用户ID")
     private Integer userId;

     @ApiModelProperty(value = "商品编号")
     private String productNo;
     
     @ApiModelProperty(value = "商品名称")
     private String productName;

     @ApiModelProperty(value = "商品副标题")
     private String productCaption;

     @ApiModelProperty(value = "商品展示图片Path")
     private String productImage;
     
     @ApiModelProperty(value = "商品是否上下架")
     private String productIsUpdown;
     
	 @ApiModelProperty(value = "SKU商品规格值")
	 private List<ProductSkuSpecificationItem> skuItems;
     
     @ApiModelProperty(value = "SKU商品号")
     private String skuNo;
     
     @ApiModelProperty(value = "表框编号")
     private String frameNo;
     
     @ApiModelProperty(value = "表框名称")
     private String frameName;
     
     @ApiModelProperty(value = "表框价格")
     private BigDecimal framePrice;
     
     @ApiModelProperty(value = "价格")
     private BigDecimal price;

     @ApiModelProperty(value = "数量")
     private Integer quantity;
     
     @ApiModelProperty(value = "运费")
     private BigDecimal freightFee;
     
 	@ApiModelProperty(value = "库存数量")
 	private BigDecimal stockNum;

 	@ApiModelProperty(value = "冻结数量")
 	private BigDecimal stockFreezeNum;
 	
 	//======================================
 	
 	@ApiModelProperty(value = "业务扩展1")
	private String bizValue1;

	@ApiModelProperty(value = "业务扩展2")
	private String bizValue2;

	@ApiModelProperty(value = "业务扩展3")
	private String bizValue3;

	@ApiModelProperty(value = "业务扩展4")
	private String bizValue4;

	@ApiModelProperty(value = "业务扩展5")
	private String bizValue5;
	
	@ApiModelProperty(value = "业务扩展6")
	private String bizValue6;

	@ApiModelProperty(value = "业务扩展7")
	private String bizValue7;

	@ApiModelProperty(value = "业务扩展8")
	private String bizValue8;

	@ApiModelProperty(value = "业务扩展9")
	private String bizValue9;

	@ApiModelProperty(value = "业务扩展10")
	private String bizValue10;

	@ApiModelProperty(value = "业务扩展11")
	private String bizValue11;

	@ApiModelProperty(value = "业务扩展12")
	private String bizValue12;

	@ApiModelProperty(value = "业务扩展13")
	private String bizValue13;

	@ApiModelProperty(value = "业务扩展14")
	private String bizValue14;

	@ApiModelProperty(value = "业务扩展15")
	private String bizValue15;

	@ApiModelProperty(value = "业务扩展16")
	private String bizValue16;

	@ApiModelProperty(value = "业务扩展17")
	private String bizValue17;

	@ApiModelProperty(value = "业务扩展18")
	private String bizValue18;

	@ApiModelProperty(value = "业务扩展19")
	private String bizValue19;

	@ApiModelProperty(value = "业务扩展20")
	private String bizValue20;
	
    @ApiModelProperty(value = "作家列表")
    private List<Map<String, Object>> artists;
    

	public CartItemModel(CartInfo entity) {
		this.id=entity.getId();
		this.userId=entity.getUserId();
		this.productNo=entity.getProductNo();
		this.skuNo=entity.getSkuNo();
		this.frameNo=entity.getFrameNo();
		this.productIsUpdown=entity.getProductIsUpdown();
		this.quantity=entity.getQuantity();
	}
	
	public void addArtist(Map<String, Object> item) {
		if(this.artists==null) {
			this.artists=new ArrayList<Map<String,Object>>();
		}
		if(item!=null) {
			this.artists.add(item);
		}
	}
     
}
